﻿/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * 
*     ___                              __                 _       __              __     __       *
*    /   |   _____ ____   ___   _____ /_/____   ____     | |     / /____   _____ / /____/ /_____  *
*   / /| |  / ___// __ \ / _ \ / ___// // __ \ / __ \    | | /| / // __ \ / ___// // __  // ___/  *
*  / ___ | _\_ \ / /_/ //  __// /   / // /_/ // / / /    | |/ |/ // /_/ // /   / // /_/ /_\_ \    *
* /_/  |_|/____// ____/ \___//_/   /_/ \____//_/ /_/     |__/|__/ \____//_/   /_/ \____//____/    *
*              /_/                                                                                *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Worlds.Application.Configuration
{
    /// <summary>
    /// Server configuration, used to store server configuration settings.
    /// </summary>
    public class ServerConfiguration
    {
        /// <summary>
        /// GameName changed event, raised when the GameName setting is changed.
        /// </summary>
        public static event EventHandlers.ConfigurationStringHandler GameName_Changed;
        /// <summary>
        /// The GameName setting.
        /// </summary>
        private String _GameName { get; set; }
        /// <summary>
        /// The GameName setting.
        /// </summary>
        public String GameName { get { return this._GameName; } set { String tmpVar = value; if(GameName_Changed != null) GameName_Changed(ref tmpVar); this._GameName = tmpVar; } }


        /// <summary>
        /// Class constructor, sets default variables.
        /// </summary>
        public ServerConfiguration()
        {
            /* Default game settings. */
            this._GameName = "Asperion Worlds";
        }

        /// <summary>
        /// Set's configuration data with a different configuration object.
        /// </summary>
        /// <param name="newData">THe new data to set.</param>
        public void set(ServerConfiguration newData)
        {
            /* Update game settings. */
            this.GameName = newData.GameName;
        }
    }
}
